#include<iostream>
#include<vector>
using namespace std;

vector<int> singleNumber(vector<int>& nums) {
    int sum = 0;
    vector<int>result(2,0);
    for (int i = 0; i < nums.size(); i++)

        sum ^= nums[i];
    int count = 1;
    while ((count &sum) == 0)
        count <<= 1;
 
    for (int i = 0; i < nums.size(); i++)
    {
        if ((nums[i]>>count & 1) == 1)
        {
            result[0] ^= nums[i];


        }
        else
        {
            result[1] ^= nums[i];

        }
           
       
           
    }
    return result;
   














}
int main()
{
       int arr1[]={1, 2, 1, 3, 2, 5};
       vector<int> arr(arr1, arr1+6);
       vector<int>get;
       get=singleNumber(arr);
       for (auto e : get)
       {
           cout << e << endl;


       }


}
class Solution {

public:

    int singleNumber(vector<int>& nums) {

        int res = nums[0];

        for (int i = 1; i < nums.size(); i++)

        {

            res ^= nums[i];







        }

        return  res;



    }

};
class Solution {

public:

    vector<vector<int>> generate(int numRows) {

        vector<vector<int>>result(numRows);

        for (int i = 0; i < numRows; i++)

        {
            result[i].resize(i + 1, 0);

            result[i][0] = result[i][result[i].size() - 1] = 1;

        }

        for (int i = 0; i < numRows; i++)

        {
            for (int j = 0; j < result[i].size(); j++)

            {

                if (result[i][j] == 1)

                    continue;



                if (result[i][j] != 1)

                {
                    result[i][j] = result[i - 1][j] + result[i - 1][j - 1];
                }





            }













        }









        return result;









    }



}; class Solution {

public:

    int singleNumber(vector<int>& nums) {

        sort(nums.begin(), nums.end());

        if (nums.size() == 1)

            return nums[0];

        int i;

        if (nums[1] != nums[0])

            return nums[0];



        for (i = 1; i < nums.size() - 1; i++)

        {
            if (nums[i] == nums[i + 1] || nums[i] == nums[i - 1])

                continue;



            break;

        }



        return nums[i];



    }



};
class Solution {

public:

    vector<int> singleNumber(vector<int>& nums) {

        int sum = 0;

        vector<int>result(2, 0);

        for (int i = 0; i < nums.size(); i++)



            sum ^= nums[i];

        int count = 1;

        while ((count & sum) == 0)

            count <<= 1;



        for (int i = 0; i < nums.size(); i++)

        {

            if ((nums[i] & count) == 0)

            {

                result[0] ^= nums[i];





            }

            else

            {

                result[1] ^= nums[i];



            }







        }

        return result;

    }

};